FROM omega8/diyix:latest
MAINTAINER omega
USER root
EXPOSE 8080

RUN wget "http://resource.omega.pw/software/nginx/nginx-1.12.0-proxy.tar.gz" \
&& tar -zxf nginx-1.12.0-proxy.tar.gz \
&& rm -rf nginx-1.12.0-proxy.tar.gz \
&& cd nginx-proxy \
&& ./install.sh \
&& cd .. \
&& rm -rf nginx-proxy\
&& sed -i -e "s/listen\s*80;/listen 8080;/" -e "s/desthost/192.168.129.1/" /usr/local/nginx/conf/nginx.conf

CMD ["/bin/sh", "-c", "cd /usr/local/nginx/sbin && ./nginx -g 'daemon off;'"]
